package controller;

import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

public class ToMain {
    public static void toMain(Button button,Pane root){
        Stage stage=(Stage) button.getScene().getWindow();
        stage.close();
        Stage main=new Stage();
        Scene scene=new Scene(root);
        main.setScene(scene);
        main.getIcons().add(new Image("/Interface/Icon.png"));
        main.setTitle("超星学习通");
        main.setResizable(false);
        main.show();
    }
}